/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 故我
 * Date: 2023-06-12
 * Time: 13:59
 */
public class Testdemo3 {
    public static void main(String[] args) {
        //求1000以内的完数
        for (int i = 2; i <= 10000; i++) {
            int tmp = i;
            int sum = 0;
            for (int j = 1; j <= tmp / 2; j++) {
                if (tmp % j == 0) {
                    sum += j;
                }
            }

            if(sum == tmp){
                System.out.print(tmp+" ");
            }
        }
    }
}
